1. Technical Field
The present invention relates in general to rendering in data processing system displays and in particular to rendering primitives processed as multiple blocks of pixels. Still more particularly, the present invention relates to improving efficiency in rendering textured primitives or small spans within primitives.
2. Description of the Related Art
Rendering is employed within data processing systems to create two dimensional images for display on a monitor. Typically, rendering includes processing geometric primitives (e.g., points, lines and polygons) to determine component pixel values for the monitor display, a process often referred to specifically as rasterization.
The pixels for the display area of a data processing system monitor are conventionally viewed as a matrix mapping to one or more frame buffers, or segments of memory holding a corresponding portion of the pixel information (Z, alpha, and color values, texture coordinates, deltas, etc.), and/or texture memory, containing texture elements or xe2x80x9ctexelsxe2x80x9d for a pixel position, which are utilized to generate or refresh the display screen.
Current graphic subsystems typically employ a multiple pixel interface to the frame buffer and texture memory in order to achieve the bandwidth necessary for rendering at acceptable speeds. For simplicity and costs reasons, these pixels are accessed in fixed groups usually organized as a span in the horizontal or vertical direction since most rendering algorithms are span based (that is, primitives are rendered one or more spans at a time). This organization and method of rendering is inefficient for small spans and textured primitives.
A common organization, for example, employs an eight pixel interface to the frame buffer, organized as eight consecutive pixels (an 8xc3x971 block) from a single horizontal or vertical span. In such a system, rendering requires a separate frame buffer or cache access for each span, which is inefficient for primitives or portions of primitives ranging across spans of significantly less than eight pixels. Moreover, texture mapping requires eight texels for tri-linear mip-mappingxe2x80x94four pixels each from the two nearest mip-map levelsxe2x80x94which are accessed and blended to calculate the texture for one pixel. With scan line organization, texel reuse during texture mapping may be virtually nonexistent.
It would be desirable, therefore, to provide a rendering method optimized for both small scan lines and texture mapping.
It is therefore one object of the present invention to provide improved rendering for data processing system displays.
It is another object of the present invention to provide improved rendering of primitives processed as multiple blocks of pixels.
It is yet another object of the present invention to provide improved efficiency in rendering textured primitives or small spans within primitives.
The foregoing objects are achieved as is now described. Primitives are divided into span groups of 2N spans, and then processed in Mxc3x97N blocks of pixels, with the pixel blocks preferably being as close to square as possible and therefore optimized for small spans and texture mapping. Each span group is rendered block-by-block in a serpentine manner from an initial or entry block, first in a direction away from the long edge of the primitive and then in a direction towards the long edge. The interpolators include a one-deep stack onto which pixel and texel information for the initial or entry block are pushed before rendering any other blocks within the span group. Blocks or pairs of blocks within different span subgroups of the span group are then alternately rendered, such that rendering zig-zags between the span subgroups as it proceeds to the end of the span group. Once the first end of a span group is reached, the values for the initial or entry block are popped from the stack and rendering resumes from the initial or entry block in the opposite direction, but in the same serpentine or zig-zag manner, until the other end of the span group is reached. The next span group, if any, is rendered starting with a block adjacent to the last block rendered in the previous span group. Memory bandwidth utilization between the pixel and texel cache and the frame buffer is thus improved, together with texel reuse during texture mapping, to reduce the total number of pixel and texel fetches required to render the primitive.
The above as well as additional objects, features, and advantages of the present invention will become apparent in the following detailed written description.